package com.neu.cloudFactory.VO;

import com.neu.cloudFactory.DAO.UserDAO;
import com.neu.cloudFactory.PO.Factory;
import com.neu.cloudFactory.PO.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class FactoryVO {


    private String id;
    private String name;
    private String detail;
    private String manager;
    private String phone;
    private String account;
    private String state;

    public FactoryVO(Factory factory, User user){
        this.id = Integer.toString(factory.getId());
        this.name = factory.getName();
        this.detail = factory.getDetail();
        this.manager = user.getName();
        this.phone = user.getPhone();
        this.account = user.getAccount();
        this.state = factory.getState();
    }

}
